package com.rg1906.dao.Impl;

import java.sql.SQLException;
import java.util.List;

import javax.sql.DataSource;

import org.apache.commons.dbutils.QueryRunner;
import org.apache.commons.dbutils.handlers.BeanListHandler;

import com.rg1906.entity.QueryRole;
import com.rg1906.utils.DataSourceC3P0ThreadLocal;

public class QueryRoleDaoImpl {
	DataSource dataSource = DataSourceC3P0ThreadLocal.getDataSource();
	QueryRunner qr = new QueryRunner(dataSource);
	public List<QueryRole> queryList() throws SQLException {
		String sql="select id,roleName from t_role";
		return qr.query(sql, new BeanListHandler<>(QueryRole.class));
	}
	
}
